package top.truism.auth.web.controller;

import org.springframework.web.bind.annotation.*;
import top.truism.auth.annotation.*;
import top.truism.auth.permission.PermissionMeta;
import top.truism.auth.permission.PermissionModule;
import top.truism.auth.web.pojo.Book;

@RestController
@RequestMapping("/books")
@PermissionModule("图书模块")
public class BookController {

  @GetMapping("/")
  @TouristMeta("图书列表")
  public boolean getBookList() {
    System.out.println("图书列表");
    return true;
  }

  @PostMapping("/")
  @GroupMeta("添加图书")
  public boolean addBook(@RequestBody Book book) {
    System.out.println("添加图书");
    return true;
  }

  @DeleteMapping("/{id}")
 @AdminMeta("删除图书")
  public boolean deleteBook(@PathVariable Integer id) {
    System.out.println("删除图书");
    return true;
  }

}
